package com.joven.interface1.localService.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.joven.core.model.User;
import com.joven.interface1.localService.TestService;
import com.joven.interface1.mapper.TestMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 * @author joven_wong
 * 2021/6/4 16:54
 */
@Service
public class TestServiceImpl extends ServiceImpl<TestMapper, User>  implements TestService {


    private TestMapper testMapper;

    @Autowired
    public void setTestMapper(TestMapper testMapper) {
        this.testMapper = testMapper;
    }


    @Override
    @Cacheable(value = "dubbo", key = "#id")
    public User getOneById(Long id) {
        return testMapper.selectById(id);
    }
}
